package util;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by Administrator on 2016/4/11.
 */
public class DBUtil extends SQLiteOpenHelper {
    public DBUtil(Context context){
        super(context,"txt.db",null,1);
    }

    public DBUtil(Context context, String name,CursorFactory factory,int version){
        super(context,name,factory,version);

    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql="create table txt(id Integer primary key,full_path text,now_page Integer,over_flag Integer)";
        db.execSQL(sql);
        sql="create table page(id Integer primary key,txt_id Integer,content text,page_num Integer)";
        db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
